home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / jar / nsIZipReader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  15KB  |  446 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIZipReader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIZipReader_h__
  6. #define __gen_nsIZipReader_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsISimpleEnumerator; /* forward declaration */
  18.  
  19. class nsIInputStream; /* forward declaration */
  20.  
  21. class nsIFile; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIZipEntry */
  25. #define NS_IZIPENTRY_IID_STR "6ca5e43e-9632-11d3-8cd9-0060b0fc14a3"
  26.  
  27. #define NS_IZIPENTRY_IID \
  28.   {0x6ca5e43e, 0x9632, 0x11d3, \
  29.     { 0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}
  30.  
  31. class NS_NO_VTABLE nsIZipEntry : public nsISupports {
  32.  public: 
  33.  
  34.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IZIPENTRY_IID)
  35.  
  36.   /* readonly attribute string name; */
  37.   NS_IMETHOD GetName(char * *aName) = 0;
  38.  
  39.   /* readonly attribute unsigned short compression; */
  40.   NS_IMETHOD GetCompression(PRUint16 *aCompression) = 0;
  41.  
  42.   /* readonly attribute unsigned long size; */
  43.   NS_IMETHOD GetSize(PRUint32 *aSize) = 0;
  44.  
  45.   /* readonly attribute unsigned long realSize; */
  46.   NS_IMETHOD GetRealSize(PRUint32 *aRealSize) = 0;
  47.  
  48.   /* readonly attribute unsigned long CRC32; */
  49.   NS_IMETHOD GetCRC32(PRUint32 *aCRC32) = 0;
  50.  
  51. };
  52.  
  53. /* Use this macro when declaring classes that implement this interface. */
  54. #define NS_DECL_NSIZIPENTRY \
  55.   NS_IMETHOD GetName(char * *aName); \
  56.   NS_IMETHOD GetCompression(PRUint16 *aCompression); \
  57.   NS_IMETHOD GetSize(PRUint32 *aSize); \
  58.   NS_IMETHOD GetRealSize(PRUint32 *aRealSize); \
  59.   NS_IMETHOD GetCRC32(PRUint32 *aCRC32); 
  60.  
  61. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  62. #define NS_FORWARD_NSIZIPENTRY(_to) \
  63.   NS_IMETHOD GetName(char * *aName) { return _to GetName(aName); } \
  64.   NS_IMETHOD GetCompression(PRUint16 *aCompression) { return _to GetCompression(aCompression); } \
  65.   NS_IMETHOD GetSize(PRUint32 *aSize) { return _to GetSize(aSize); } \
  66.   NS_IMETHOD GetRealSize(PRUint32 *aRealSize) { return _to GetRealSize(aRealSize); } \
  67.   NS_IMETHOD GetCRC32(PRUint32 *aCRC32) { return _to GetCRC32(aCRC32); } 
  68.  
  69. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  70. #define NS_FORWARD_SAFE_NSIZIPENTRY(_to) \
  71.   NS_IMETHOD GetName(char * *aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  72.   NS_IMETHOD GetCompression(PRUint16 *aCompression) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCompression(aCompression); } \
  73.   NS_IMETHOD GetSize(PRUint32 *aSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSize(aSize); } \
  74.   NS_IMETHOD GetRealSize(PRUint32 *aRealSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRealSize(aRealSize); } \
  75.   NS_IMETHOD GetCRC32(PRUint32 *aCRC32) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCRC32(aCRC32); } 
  76.  
  77. #if 0
  78. /* Use the code below as a template for the implementation class for this interface. */
  79.  
  80. /* Header file */
  81. class nsZipEntry : public nsIZipEntry
  82. {
  83. public:
  84.   NS_DECL_ISUPPORTS
  85.   NS_DECL_NSIZIPENTRY
  86.  
  87.   nsZipEntry();
  88.  
  89. private:
  90.   ~nsZipEntry();
  91.  
  92. protected:
  93.   /* additional members */
  94. };
  95.  
  96. /* Implementation file */
  97. NS_IMPL_ISUPPORTS1(nsZipEntry, nsIZipEntry)
  98.  
  99. nsZipEntry::nsZipEntry()
  100. {
  101.   /* member initializers and constructor code */
  102. }
  103.  
  104. nsZipEntry::~nsZipEntry()
  105. {
  106.   /* destructor code */
  107. }
  108.  
  109. /* readonly attribute string name; */
  110. NS_IMETHODIMP nsZipEntry::GetName(char * *aName)
  111. {
  112.     return NS_ERROR_NOT_IMPLEMENTED;
  113. }
  114.  
  115. /* readonly attribute unsigned short compression; */
  116. NS_IMETHODIMP nsZipEntry::GetCompression(PRUint16 *aCompression)
  117. {
  118.     return NS_ERROR_NOT_IMPLEMENTED;
  119. }
  120.  
  121. /* readonly attribute unsigned long size; */
  122. NS_IMETHODIMP nsZipEntry::GetSize(PRUint32 *aSize)
  123. {
  124.     return NS_ERROR_NOT_IMPLEMENTED;
  125. }
  126.  
  127. /* readonly attribute unsigned long realSize; */
  128. NS_IMETHODIMP nsZipEntry::GetRealSize(PRUint32 *aRealSize)
  129. {
  130.     return NS_ERROR_NOT_IMPLEMENTED;
  131. }
  132.  
  133. /* readonly attribute unsigned long CRC32; */
  134. NS_IMETHODIMP nsZipEntry::GetCRC32(PRUint32 *aCRC32)
  135. {
  136.     return NS_ERROR_NOT_IMPLEMENTED;
  137. }
  138.  
  139. /* End of implementation class template. */
  140. #endif
  141.  
  142.  
  143. /* starting interface:    nsIZipReader */
  144. #define NS_IZIPREADER_IID_STR "6ff6a966-9632-11d3-8cd9-0060b0fc14a3"
  145.  
  146. #define NS_IZIPREADER_IID \
  147.   {0x6ff6a966, 0x9632, 0x11d3, \
  148.     { 0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}
  149.  
  150. class NS_NO_VTABLE nsIZipReader : public nsISupports {
  151.  public: 
  152.  
  153.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IZIPREADER_IID)
  154.  
  155.   /**
  156.      * Initializes a zip reader after construction.
  157.      */
  158.   /* void init (in nsIFile zipFile); */
  159.   NS_IMETHOD Init(nsIFile *zipFile) = 0;
  160.  
  161.   /* readonly attribute nsIFile file; */
  162.   NS_IMETHOD GetFile(nsIFile * *aFile) = 0;
  163.  
  164.   /**
  165.      * Opens a zip reader.
  166.      */
  167.   /* void open (); */
  168.   NS_IMETHOD Open(void) = 0;
  169.  
  170.   /**
  171.      * Closes a zip reader. Subsequent attempts to extract files or read from
  172.      * its input stream will result in an error.
  173.      */
  174.   /* void close (); */
  175.   NS_IMETHOD Close(void) = 0;
  176.  
  177.   /**
  178.      * Tests the integrity of the archive by performing a CRC check 
  179.      * on each item expanded into memory.  If an entry is specified
  180.      * the integrity of only that item is tested.  If NULL is passed 
  181.      * in the inetgrity of all items in the archive are tested.  
  182.      */
  183.   /* void test (in string aEntryName); */
  184.   NS_IMETHOD Test(const char *aEntryName) = 0;
  185.  
  186.   /**
  187.      * Extracts a zip entry into a local file specified by outFile.
  188.      */
  189.   /* void extract (in string zipEntry, in nsIFile outFile); */
  190.   NS_IMETHOD Extract(const char *zipEntry, nsIFile *outFile) = 0;
  191.  
  192.   /**
  193.      * Returns a nsIZipEntry describing a specified zip entry.
  194.      */
  195.   /* nsIZipEntry getEntry (in string zipEntry); */
  196.   NS_IMETHOD GetEntry(const char *zipEntry, nsIZipEntry **_retval) = 0;
  197.  
  198.   /**
  199.      * Returns a simple enumerator whose elements are of type nsIZipEntry.
  200.      */
  201.   /* nsISimpleEnumerator findEntries (in string aPattern); */
  202.   NS_IMETHOD FindEntries(const char *aPattern, nsISimpleEnumerator **_retval) = 0;
  203.  
  204.   /**
  205.      * Returns an input stream containing the contents of the specified zip entry.
  206.      */
  207.   /* nsIInputStream getInputStream (in string zipEntry); */
  208.   NS_IMETHOD GetInputStream(const char *zipEntry, nsIInputStream **_retval) = 0;
  209.  
  210. };
  211.  
  212. /* Use this macro when declaring classes that implement this interface. */
  213. #define NS_DECL_NSIZIPREADER \
  214.   NS_IMETHOD Init(nsIFile *zipFile); \
  215.   NS_IMETHOD GetFile(nsIFile * *aFile); \
  216.   NS_IMETHOD Open(void); \
  217.   NS_IMETHOD Close(void); \
  218.   NS_IMETHOD Test(const char *aEntryName); \
  219.   NS_IMETHOD Extract(const char *zipEntry, nsIFile *outFile); \
  220.   NS_IMETHOD GetEntry(const char *zipEntry, nsIZipEntry **_retval); \
  221.   NS_IMETHOD FindEntries(const char *aPattern, nsISimpleEnumerator **_retval); \
  222.   NS_IMETHOD GetInputStream(const char *zipEntry, nsIInputStream **_retval); 
  223.  
  224. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  225. #define NS_FORWARD_NSIZIPREADER(_to) \
  226.   NS_IMETHOD Init(nsIFile *zipFile) { return _to Init(zipFile); } \
  227.   NS_IMETHOD GetFile(nsIFile * *aFile) { return _to GetFile(aFile); } \
  228.   NS_IMETHOD Open(void) { return _to Open(); } \
  229.   NS_IMETHOD Close(void) { return _to Close(); } \
  230.   NS_IMETHOD Test(const char *aEntryName) { return _to Test(aEntryName); } \
  231.   NS_IMETHOD Extract(const char *zipEntry, nsIFile *outFile) { return _to Extract(zipEntry, outFile); } \
  232.   NS_IMETHOD GetEntry(const char *zipEntry, nsIZipEntry **_retval) { return _to GetEntry(zipEntry, _retval); } \
  233.   NS_IMETHOD FindEntries(const char *aPattern, nsISimpleEnumerator **_retval) { return _to FindEntries(aPattern, _retval); } \
  234.   NS_IMETHOD GetInputStream(const char *zipEntry, nsIInputStream **_retval) { return _to GetInputStream(zipEntry, _retval); } 
  235.  
  236. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  237. #define NS_FORWARD_SAFE_NSIZIPREADER(_to) \
  238.   NS_IMETHOD Init(nsIFile *zipFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(zipFile); } \
  239.   NS_IMETHOD GetFile(nsIFile * *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(aFile); } \
  240.   NS_IMETHOD Open(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Open(); } \
  241.   NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
  242.   NS_IMETHOD Test(const char *aEntryName) { return !_to ? NS_ERROR_NULL_POINTER : _to->Test(aEntryName); } \
  243.   NS_IMETHOD Extract(const char *zipEntry, nsIFile *outFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->Extract(zipEntry, outFile); } \
  244.   NS_IMETHOD GetEntry(const char *zipEntry, nsIZipEntry **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEntry(zipEntry, _retval); } \
  245.   NS_IMETHOD FindEntries(const char *aPattern, nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->FindEntries(aPattern, _retval); } \
  246.   NS_IMETHOD GetInputStream(const char *zipEntry, nsIInputStream **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInputStream(zipEntry, _retval); } 
  247.  
  248. #if 0
  249. /* Use the code below as a template for the implementation class for this interface. */
  250.  
  251. /* Header file */
  252. class nsZipReader : public nsIZipReader
  253. {
  254. public:
  255.   NS_DECL_ISUPPORTS
  256.   NS_DECL_NSIZIPREADER
  257.  
  258.   nsZipReader();
  259.  
  260. private:
  261.   ~nsZipReader();
  262.  
  263. protected:
  264.   /* additional members */
  265. };
  266.  
  267. /* Implementation file */
  268. NS_IMPL_ISUPPORTS1(nsZipReader, nsIZipReader)
  269.  
  270. nsZipReader::nsZipReader()
  271. {
  272.   /* member initializers and constructor code */
  273. }
  274.  
  275. nsZipReader::~nsZipReader()
  276. {
  277.   /* destructor code */
  278. }
  279.  
  280. /* void init (in nsIFile zipFile); */
  281. NS_IMETHODIMP nsZipReader::Init(nsIFile *zipFile)
  282. {
  283.     return NS_ERROR_NOT_IMPLEMENTED;
  284. }
  285.  
  286. /* readonly attribute nsIFile file; */
  287. NS_IMETHODIMP nsZipReader::GetFile(nsIFile * *aFile)
  288. {
  289.     return NS_ERROR_NOT_IMPLEMENTED;
  290. }
  291.  
  292. /* void open (); */
  293. NS_IMETHODIMP nsZipReader::Open()
  294. {
  295.     return NS_ERROR_NOT_IMPLEMENTED;
  296. }
  297.  
  298. /* void close (); */
  299. NS_IMETHODIMP nsZipReader::Close()
  300. {
  301.     return NS_ERROR_NOT_IMPLEMENTED;
  302. }
  303.  
  304. /* void test (in string aEntryName); */
  305. NS_IMETHODIMP nsZipReader::Test(const char *aEntryName)
  306. {
  307.     return NS_ERROR_NOT_IMPLEMENTED;
  308. }
  309.  
  310. /* void extract (in string zipEntry, in nsIFile outFile); */
  311. NS_IMETHODIMP nsZipReader::Extract(const char *zipEntry, nsIFile *outFile)
  312. {
  313.     return NS_ERROR_NOT_IMPLEMENTED;
  314. }
  315.  
  316. /* nsIZipEntry getEntry (in string zipEntry); */
  317. NS_IMETHODIMP nsZipReader::GetEntry(const char *zipEntry, nsIZipEntry **_retval)
  318. {
  319.     return NS_ERROR_NOT_IMPLEMENTED;
  320. }
  321.  
  322. /* nsISimpleEnumerator findEntries (in string aPattern); */
  323. NS_IMETHODIMP nsZipReader::FindEntries(const char *aPattern, nsISimpleEnumerator **_retval)
  324. {
  325.     return NS_ERROR_NOT_IMPLEMENTED;
  326. }
  327.  
  328. /* nsIInputStream getInputStream (in string zipEntry); */
  329. NS_IMETHODIMP nsZipReader::GetInputStream(const char *zipEntry, nsIInputStream **_retval)
  330. {
  331.     return NS_ERROR_NOT_IMPLEMENTED;
  332. }
  333.  
  334. /* End of implementation class template. */
  335. #endif
  336.  
  337.  
  338. /* starting interface:    nsIZipReaderCache */
  339. #define NS_IZIPREADERCACHE_IID_STR "52c45d86-0cc3-11d4-986e-00c04fa0cf4a"
  340.  
  341. #define NS_IZIPREADERCACHE_IID \
  342.   {0x52c45d86, 0x0cc3, 0x11d4, \
  343.     { 0x98, 0x6e, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}
  344.  
  345. class NS_NO_VTABLE nsIZipReaderCache : public nsISupports {
  346.  public: 
  347.  
  348.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IZIPREADERCACHE_IID)
  349.  
  350.   /**
  351.      * Initializes a new zip reader cache. 
  352.      * @param cacheSize - the number of released entries to maintain before
  353.      *   beginning to throw some out (note that the number of outstanding
  354.      *   entries can be much greater than this number -- this is the count
  355.      *   for those otherwise unused entries)
  356.      */
  357.   /* void init (in unsigned long cacheSize); */
  358.   NS_IMETHOD Init(PRUint32 cacheSize) = 0;
  359.  
  360.   /**
  361.      * Returns a (possibly shared) nsIZipReader for an nsIFile.
  362.      */
  363.   /* nsIZipReader getZip (in nsIFile zipFile); */
  364.   NS_IMETHOD GetZip(nsIFile *zipFile, nsIZipReader **_retval) = 0;
  365.  
  366. };
  367.  
  368. /* Use this macro when declaring classes that implement this interface. */
  369. #define NS_DECL_NSIZIPREADERCACHE \
  370.   NS_IMETHOD Init(PRUint32 cacheSize); \
  371.   NS_IMETHOD GetZip(nsIFile *zipFile, nsIZipReader **_retval); 
  372.  
  373. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  374. #define NS_FORWARD_NSIZIPREADERCACHE(_to) \
  375.   NS_IMETHOD Init(PRUint32 cacheSize) { return _to Init(cacheSize); } \
  376.   NS_IMETHOD GetZip(nsIFile *zipFile, nsIZipReader **_retval) { return _to GetZip(zipFile, _retval); } 
  377.  
  378. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  379. #define NS_FORWARD_SAFE_NSIZIPREADERCACHE(_to) \
  380.   NS_IMETHOD Init(PRUint32 cacheSize) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(cacheSize); } \
  381.   NS_IMETHOD GetZip(nsIFile *zipFile, nsIZipReader **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetZip(zipFile, _retval); } 
  382.  
  383. #if 0
  384. /* Use the code below as a template for the implementation class for this interface. */
  385.  
  386. /* Header file */
  387. class nsZipReaderCache : public nsIZipReaderCache
  388. {
  389. public:
  390.   NS_DECL_ISUPPORTS
  391.   NS_DECL_NSIZIPREADERCACHE
  392.  
  393.   nsZipReaderCache();
  394.  
  395. private:
  396.   ~nsZipReaderCache();
  397.  
  398. protected:
  399.   /* additional members */
  400. };
  401.  
  402. /* Implementation file */
  403. NS_IMPL_ISUPPORTS1(nsZipReaderCache, nsIZipReaderCache)
  404.  
  405. nsZipReaderCache::nsZipReaderCache()
  406. {
  407.   /* member initializers and constructor code */
  408. }
  409.  
  410. nsZipReaderCache::~nsZipReaderCache()
  411. {
  412.   /* destructor code */
  413. }
  414.  
  415. /* void init (in unsigned long cacheSize); */
  416. NS_IMETHODIMP nsZipReaderCache::Init(PRUint32 cacheSize)
  417. {
  418.     return NS_ERROR_NOT_IMPLEMENTED;
  419. }
  420.  
  421. /* nsIZipReader getZip (in nsIFile zipFile); */
  422. NS_IMETHODIMP nsZipReaderCache::GetZip(nsIFile *zipFile, nsIZipReader **_retval)
  423. {
  424.     return NS_ERROR_NOT_IMPLEMENTED;
  425. }
  426.  
  427. /* End of implementation class template. */
  428. #endif
  429.  
  430. #define NS_ZIPREADER_CID                             \
  431. { /* 7526a738-9632-11d3-8cd9-0060b0fc14a3 */         \
  432.     0x7526a738,                                      \
  433.     0x9632,                                          \
  434.     0x11d3,                                          \
  435.     {0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
  436. }
  437. #define NS_ZIPREADERCACHE_CID                        \
  438. { /* 1b117e16-0cad-11d4-986e-00c04fa0cf4a */         \
  439.     0x1b117e16,                                      \
  440.     0x0cad,                                          \
  441.     0x11d4,                                          \
  442.     {0x98, 0x6e, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \
  443. }
  444.  
  445. #endif /* __gen_nsIZipReader_h__ */
  446.